package com.ludomancy.hugealien;

import java.awt.Graphics;

import com.ludomancy.gamelib.ImageStrip;
import com.ludomancy.gamelib.ResourceManager;

public class Window extends BasicEntity
{
	private ImageStrip windows;
	
	public static final int TYPE_INHABITED = 1;
	public static final int TYPE_BROKEN = 2;
	private int type;
	
	public Window(int type, int px, int py)
	{
		x = px;
		y = py;
		this.type = type;
		windows = new ImageStrip(ResourceManager.getImage("buildings.png"), 20, 22);
	}
	
	public void paint(Graphics g, int px, int py)
	{
		switch(type)
		{
			case TYPE_INHABITED:
				if(!Game.game.isOver)
				{
					windows.paint(g, City.TILE_INHABITED_WINDOW, px, py);
				}
				else
				{
					windows.paint(g, City.TILE_DARK_WINDOW, px, py);
				}
				break;
			case TYPE_BROKEN:
				windows.paint(g, City.TILE_BROKEN_WINDOW, px, py);
				break;
		}
	}

}
